package com.springboot.shanhexin.dao;

import com.springboot.shanhexin.entity.my_tourist;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Component(value = "my_touristDao")
public interface my_touristDao {

    //我的路线：my_tourist

    /**
     * 搜索并显示
     * @return
     */
    @Select("select a.* from my_tourist a,userinfo b where a.uid=#{uid} and " +
            "a.uid=b.openid and title=#{title}")
    List<my_tourist> find(@Param("uid")String uid,@Param("title")String title);

    /**
     * 新增
     */
    @Insert("insert into my_tourist(uid,title,tourist,walk_time) " +
            "values(#{uid},#{title},#{tourist},#{walk_time})")
    void add(my_tourist my_tourist);

    /**
     * 删除
     */
    @Delete("delete from my_tourist where id=#{id}")
    void delete(@Param("id")int id);

}
